package com.foreknow.dao.impl;

import com.foreknow.db.JdbcTemplate;
import com.foreknow.mapping.MappingFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.sql.Connection;

public class BaseDao {
    //模板类的对象
    public JdbcTemplate jdbcTemplate = JdbcTemplate.getInstance();
    //工厂类的对象
    public MappingFactory mappingFactory = MappingFactory.getInstance();
    public Log logger = LogFactory.getLog("DaoLogger");

    /**
     * 注入数据库的连接
     * @param connection
     */
    public void setConnection(Connection connection){
        jdbcTemplate.setConnection(connection);
    }

}
